#include<bits/stdc++.h>
using namespace std;
const int MAXN=,MAXM=;
int nxt[MAXM],lena,lenb;
char a[MAXN],b[MAXM];
void cal_next()
{
	nxt[0]=-1;
	int k=-1;
	for(int i=1;i<lenb;++i)
	{
		while(~k&&b[k+1]!=b[i])k=nxt[k];
		if(b[k+1]==b[i])++k;
		nxt[i]=k;
	}
	return;
}
int KMP()
{
	int j=-1,ans=0;
	for(int i=0;i<lena;++i)
	{
		while(~j&&b[j+1]!=a[i])j=nxt[j];
		if(a[i]==b[j+1])++j;
		if(j==lenb-1)
		{
			++ans;
			j=nxt[j];
		}
	}
	return ans;
}
int main()
{
	gets(a);lena=strlen(a);
	gets(b);lenb=strlen(b);
	cal_next();
	printf("%d\n",KMP());
	return 0;
}
